//
//  KLBookTag.m
//  KLBookStore
//
//  Created by apple on 2017/10/15.
//  Copyright © 2017年 NetEaseExam. All rights reserved.
//

#import "KLBookTag.h"

@implementation KLBookTag

- (instancetype)initWithDictionary:(NSDictionary *)dict {
    KLBookTag *tag = [[[self class] alloc] init];
    tag.bookId = [[dict objectForKey:@"bookId"] longLongValue];
    tag.name = [dict objectForKey:@"name"];
    tag.count = [[dict objectForKey:@"count"] longValue];
    return tag;
}

- (instancetype)initWithFMResultSet:(FMResultSet *)resultSet {
    KLBookTag *tag = [[[self class] alloc] init];
    
    tag.bookId = [resultSet longLongIntForColumn:@"bookId"];
    tag.name = [resultSet stringForColumn:@"name"];
    tag.count = [resultSet longForColumn:@"count"];
    
    return tag;
}

- (id)copyWithZone:(NSZone *)zone {
    KLBookTag *tag = [[[self class] allocWithZone:zone] init];
    tag.bookId = self.bookId;
    tag.name = [self.name copy];
    tag.count = self.count;
    
    return tag;
}

@end
